const path = require('path');
const files = require.context("/public/md/项目实战", false, /\.md$/);

// 热门项目
const hotList = [];
files.keys().forEach((key, index) => {
  const name = path.basename(key, ".md");
  const [title, createTime, hot] = name.split(".");
  hot && hotList.push({
    id: index + "",
    title: title,
    link: `/projectList/${name}`,
    createTime: createTime
  })
});
export const hotProjectList = hotList;

// 项目列表
const list = [];
files.keys().forEach((key, index) => {
  const name = path.basename(key, ".md");
  const [title, createTime] = name.split(".");
  list.push({
    id: index + "",
    title: title,
    link: `/projectList/${name}`,
    icon: "https://developer.duyiedu.com/img/sysInterface.png",
    createTime: createTime
  })
});

export const projectList = list;
